package biz.yfsoft.app.fastframework.bo;

import java.util.Map;

import com.jfinal.plugin.activerecord.Record;

public class Bo extends Record{

	private static final long serialVersionUID = 8575578491128991292L;
	
	public static final Bo dao = new Bo();

	private static final String CREATE_TIME = "createtime";
	public static final String ID = "id";
	public static final String UPDATE_TIME = "updatetime";
	private static final String STATUS = "status";
	
	public int getId() {
		return this.get(ID);
	}

	public Bo setId(int id) {
		this.set(ID,id);
		return this;
	}

	public long getCreatetime() {
		return this.get(CREATE_TIME);
	}

	public Bo setCreatetime(long createtime) {
		this.set(CREATE_TIME,createtime);
		return this;
	}

	public long getUpdatetime() {
		return this.get(UPDATE_TIME);
	}

	public Bo setUpdatetime(long updatetime) {
		this.set(UPDATE_TIME,updatetime);
		return this;
	}

	public int getStatus() {
		return this.get(STATUS);
	}

	public Bo setStatus(int status) {
		this.set(STATUS,status);
		return this;
	}
	
	public Bo create(Map<String,Object> args){
		this.setColumns(args);
		this.setStatus(1);
		long now = System.currentTimeMillis();
		this.setCreatetime(now);
		this.setUpdatetime(now);
		return this;
	}

	@Override
	public String toString() {
		return getColumns().toString();
	}
	
	
}
